package transport

import (
	"context"
	"encoding/json"
	"net/http"
	"gowork/memberGoKit/server/endpoint"
	"fmt"
)

func DecodeMemberInsertRequest(ctx context.Context, r *http.Request)(interface{}, error){

	r.ParseForm()
	memberList := r.Form.Get("memberList")

	fmt.Println("参数", memberList)
	return endpoint.MemberRequestOrResponse{
		MemberList : memberList,
	}, nil
}

func DecodeMemberQueryRequest(ctx context.Context, r *http.Request)(interface{}, error){

	return endpoint.MemberNilRequest{

	}, nil

}

func EncodeMemberResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error{
	w.Header().Set("Content-type", "application/json")
	return json.NewEncoder(w).Encode(response)
}
